<?php

class IndexController extends AdminAbstractController
{
    public function filters()
    {
        return array(
           'accessControl' ,
        );
    }

    public function accessRules()
    {
        return array(
          /*  array('deny',
                'users' => array('*'),
            ),*/
        );
    }

    public function actionIndex()
    {
        $model = new User();
        //die(Yii::app()->user->id);
        $model->id = Yii::app()->user->id;
        //Profile::model()->findByPk(Yii::app()->user->id);
        $profile = Profile::model()->find(array(
            'condition' => 'userid=:userid',
            'params' => array(':userid' =>Yii::app()->user->id )
        ));
        $workingModel = new WorkingHistory();
        $workingModel->userid = Yii::app()->user->id;
        $workingHistories = $workingModel->getWorkingHistories();

        $studyingModel = new StudyingHistory();
        $studyingModel->userid = Yii::app()->user->id;
        $studyingHistories = $studyingModel->getWorkingHistory();
      //  var_dump($profileDataProvider);
        $this->layout = '//layouts/column2';
        $this->render('index', array(
            'profile' => $profile,
            'workingHistories' => $workingHistories,
            'studyingHistories' => $studyingHistories,
        ));

    }
}